home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-05-01 | 18.8 KB | 348 lines | [TEXT/MMCC] |
- /*
-
- Changes in 1.1b4 — 95\04\22:
- —Changed the way I send the openDoc Æ so app’s like SimpleText won’t open
- an untitled window before receiving the openDoc Æ.
- —Moved all functions for exporting search results to their own segment
- so we aren’t wasting space with it.
- —Added Grep search option — by request. The only drawback of this is that
- some of the regex functions use malloc, which allocates a huge pointer
- in the heap, even though very little of it is used. If you don’t like
- the regex options I’m using, lemme know.
- —Added pref to store last search string, mainly because I got sick of
- re–typing the same grep strings over and over while testing.
- —Oh yeah, had to turn on 4-byte int’s so regex would use long’s.
- —Implemented File Types option in the main dialog. This removes the TEXT
- Files Only checkbox from the Search Options dialog. Read the Balloon Help
- or the How To Use FS file to learn how it works.
- —Added ‘Goto’ resources so new goto–line Æ’s can be added for other app’s
- more easily without having to recompile the source.
- —Got rid of Ask Before Opening (rez files) menu item.
- —Changed other things in File menu. Use Editors menu item means use the
- appropriate editor if it’s checked, or use the file’s original creator
- if it’s unchecked. You can still force a rez fork match to be opened with
- the Data Fork Editor.
- —Restructured the way app’s are launched and files are opened when user
- double–clicks on a search result.
- —I think I updated all the Balloon Help.
- —Updated Save Results for new flags and Types & Creators.
- —Added ability to choose editors by selecting a running process. Hold the
- Option key before clicking in the File menu.
- —Added Options menu that mirrors the Search Options, File Types, and Other
- Search Dir buttons on the main window, just so it would be apparent that
- there are key equivs for the buttons (which I was going to add anyway since
- I hate using the mouse for such things).
- —Removed all the PICT’s from the help doc.
-
-
- Changes in 1.1b3 — 95\04\06:
- —Added Whole Words search option. (Requested a long time ago, but I forgot
- about it.) The table for delimiting words in resource ‘dlim’ ID 132, just
- in case you don’t like the way I’m delimiting words (0 = not part of a
- word; 1 = part of a word).
- —User reported an *extreme* slow–down on 7100/66 when RAM Doubler is
- installed. This is because File Safari uses almost all available free
- memory for the search buffer. This causes RD to go nuts. So I added an
- option called “RAM Doubler is Evil Mode” which disables FS from using
- temp mem. FS is also a tad slower with RD installed on a 68k Mac.
- —Changed email address in about box and elsewhere.
-
-
- Changes in 1.1b2 — 95\03\23:
- —Fixed bug where detailed rez search would close a rez file if the file
- was already open. Especially bad if the file happens to be File Safari’s
- own rez fork.
- —Explicitly look for a refNum == the app’s refNum so we don’t close it
- during searches.
- —Added options for exporting the Search Results:
- •Wide Format: Makes the exported text twice as wide as normal. This is
- a bit slower because it reads each found file again so
- it can get the extended data for each match.
- •Offsets & Stuff: Write a line after each match that tells the offset
- in file/rez, and rez type and ID if it was a detailed
- rez search.
- •Full Pathnames: Write the full pathname of each file instead of only the
- truncated file name.
- This whole thing turned out to be pretty messy. I cleaned it up as much as
- possible, but I wouldn’t put money on it being bug–free. That’s what beta
- testers are for!! :D
-
-
- Changes in 1.1b1 — 95\02\24:
- —Added Detailed Rez Search option to Search Options menu. What this does
- is search each rez fork rez–by–rez instead of reading the entire rez
- fork block into a single chunk. This allows the rez type and ID to be
- seen in the File Info popup seen when the mouse is held down on a match.
- —Added key equivs for the results scrollbar:
- Command–downArrow…………………………1 line down
- Command–upArrow………………………………1 line up
- Command–Option–downArrow………1 page down
- Command–Option–upArrow……………1 page up
- —Added option for searching/skipping nested folders.
- —Reworked Search Options into a dialog instead of the popup menu. This
- makes it a lot easier to set a bunch of options at once instead of
- having to aim/click/move/release a bunch of times.
- —Did away with the secret Skip Rez Header option. It will always be
- searched when not using the Detailed Rez Search option.
- —Added check to see if a dir has already been added to the Recent Search
- Dirs menu so it doesn’t show up more than once.
- —Fixed an old #define that set the pref file’s creator to the wrong
- thing when it’s created.
- —Added Search Type popup menu to main window. This gives you three options:
- •New Search: Clears the previous search results and searches as normal.
- •Append Search: Appends the next search results to the existing search
- results.
- •Search Existing: Searches only the files listed in the current search
- results list (old results cleared first).
- —Fixed a temp memory bug (not MY bug, but Apple’s:) where the actual amount
- of available free temp memory was NOT what was returned from TempMaxMem
- when called *only for the very first time* in the program (7.1, SU3.0).
- —Fixed a bug in searchInFile where it would skip searching the rest of a
- file if First Occurrence Only was turned on. Oops.
- —Fixed © date in How To… and about box.
-
-
- Release of 1.0.3 — 95\02\23.
-
-
- Changes in 1.0.3b1 — 95\02\13:
- —Added Recent Search Dirs menu item. Any search dir used from the Other…
- button or by drag & dropping a volume will be added to this submenu and
- will stick around until the program quits. { Requested by MetaTheory. }
- —The main window is now wider (640), unless the screen is <640 wide, then
- it’s the old width. { Requested by MetaTheory. }
- —Had bug report { Per.Mildner } of address 0 being dereferenced in
- ABOUTVERSUSERITEM when it called pstrcpy, but I couldn’t find anything
- wrong, unless the handle returned from GetResource was NULL. So I put in
- a check for that and passed the shortVers directly to TextBox instead of
- pstrcpy’ing it to another variable, which was senseless to begin with.
- —Fixed a Balloon Help typo.
- —Had a request to add each file’s full pathname to the export file. No,
- it wouldn’t take much to do it, but it would make the export file a lot
- harder to read, and the existing code is very clean. And since this is
- the only request for this feature, I’m opting not to do it.
- —No events could be processed after choosing “Hide File Safari” from the
- app menu after initiating a search. Setting the doesActivateOnFGSwitch
- bit in the ‘SIZE’ fixed it (but doesn’t make sense).
- —Added Command–S key equiv to Get Other Search Dir… custom get file
- box to select the Select button.
-
-
- Changes in 1.0.2 — 95\02\10 (daytime, normal person hours):
- —Found and fixed a bug where FS would crash after sending the ÆOpenDoc
- to the editor (in this case, MuffEdit) and THEN tried opening the file
- to find the line number, even though MuffEdit doesn’t support goto–line
- Æ’s. Now I get the line number *before* sending the openDoc Æ and then
- check to see if the editor handles goto–line Æ’s and only send it if
- it does. Cripes, I hate finding these things after distributing an app
- all over the damned world. I think I’ll wait a few days before releasing
- 1.0.2, just in case more bugs are found, but of course there aren’t any
- more because I’m so goll durn optimistic! :) { Bug found by MetaTheory. }
-
-
- Changes in 1.0.1 — 95\02\10:
- —Fixed bug where I tried to get the line number of a match when it was
- in a rez fork. Now the “Line Number” menu item is disabled and says
- “N/A” when a rez file match is clicked on. Yes, I ended that sentence
- with a preposition.
- —Added more tests if a file was found during the search but can’t be
- found when clicked on.
-
-
- Changes in 1.0 — 95\01\26 — final release:
- —Search buttons weren’t being updated when user did a Paste.
-
-
- Changes in 1.0b6 — 95\01\15:
- —I was messing around with passing NULL in some parms of GetDialogItem.
- This worked fine on my IIci with 7.1, but I had a report from MetaTheory
- who was running EvenBetterBusError that I was writing to NIL. Thanks to
- that EBBE, I found the problem was me passing NULL to GDI. Fixed that.
- Also found a few others.
- —Added a pref to save the position of the window.
- —Fixed something in TE32K where the top of the results text would be
- scrolled off the bottom of the window while lines of text were being
- added during a search.
- —Fixed handling of the results scrollbar thumb so the correct value is
- calculated as a long instead of a short.
- —Added extra call to smallEvent to catch aborts earlier.
- —Forgot to SetPort the about box.
- —Fixed bug in findAppInDesktops where an entry was found in the Desktop
- database, but the file no longer existed on the volume, so it skips that
- volume and searches the next.
- —Added code to send the appropriate goto–line Apple® Event to the text
- editor so the double–clicked line will be brought into view. So far the
- only goto–line Æ’s implemented are for 68k and PPC MW C/C++ and Pascal
- and BBEdit (the only editors I could find around here that support
- goto–line Æ’s).
-
-
- Changes in 1.0b5 — 94\12\30:
- —If the openDoc Æ can’t be sent to an application for some reason, I now
- ask the user if they want to use their TEXT Editor to view the file.
- —Added Hex Search button.
- —Added 1st Occurance Only option.
- —Amalgamated all search options into a single Options popup menu in the
- main window to declunkify the interface.
- —Changed flags pref into a different format that’s more easily updated in
- future versions (a long instead of a bunch of Booleans). Also, old Pref’s
- files won’t lose the user’s settings when it’s updated to a new version.
- And it’s smaller.
- —Added test for files not being able to be opened and ask user if they want
- to skip the file and continue or not.
- —Added a beep when the search has completed.
- —Added pref for keeping the last Search Dir chosen from the popup menu or
- if the user selects Add Current Search Dir. Search Dir’s chosen by any
- other means won’t be remembered. I prefer doing it this way rather than
- saving yet another alias.
- —Changed the way I keep track of found files. Used to just keep the parID
- and name. Now I just keep the parID, index, and vRefNum which takes less
- memory and so I can…
- —Now show the full pathname, type, and creator of clicked–on files in the
- results list. Also changed the font of the file name item to Geneva
- because Monaco was too long for deep folders. This is only an Str255, but
- it seems to be long enough even for deep folders on CW/4.
- —Added secret option for power users to skip or include searching the
- resource header, data reserved for system, and application data portions
- of resource files. I was finding some sort of left over garbage in the
- rez fork of an alias file (in the reserved system data area), so I
- decided to skip searching the entire area. But what if some app stores
- data in the application data area, such as passwords and stuff? This is
- why I made it a secret option. This file will be the only place it will
- be mentioned. So only people who read this file will know about it, or
- people who happen to hold down the Option key while clicking in the
- Search Options popup. (Hint; that’s how you turn the option on and
- off.:) It’s default state is on, rez header+ skipped.
- —Changed the way the main window works. Added a little triangle PICT item
- that toggles the search result items. I did this for a couple reasons:
- ◊Faster window updating if File Safari is kept hanging around while
- using other app’s. Just hide the result items when not in use.
- ◊Thinking about adding boxes for the clicked–on file’s Type, Creator,
- and the offset of the match in the file. These extra items would make
- more clutter, which would make reason #1 more attractive.
- ◊I’ve never used AppendDITL before, so it was good practice. :)
- —Added a total files searched item.
- —Replaced all calls to CallUserItemProc with the actual function calls
- they contain. (New habits are hard to break.;)
- —Fixed some things in the search code. Tested it with a file of buffSize
- length. It now finds only one match if the search string is right at the
- end of the buffer. I was also doing the same long calculation twice, so
- I replaced that with a local var (but CodeWarrior was probably optimizing
- that on its own).
- —Instead of adding the Type, Creator, and offset boxes, I added a popup
- that shows this into for each match. Just click and hold on a match for
- your system’s double–click time and the popup will appear.
- —Got CW5 in the mail! Only had to make one change!
- —Made full use of CW5’s new PPC optimization. Too bad I can’t tell the
- difference. :/ (Somebody give me an 8100 or I’ll puke all over my code.)
- —Started using temp memory for the search buffers if enough is available.
- —Changed searchInFile’s inner loop to be more efficient.
- —Made my own Munger function to handle both normal and case–ignored
- searches, using a lookup table for case–ignored conversion. It’s 67%
- faster than Munger normally and 54% faster than my use of Munger when
- ignoring case. A full case–sensitive search of File Safari’s project
- folder took an average of 4.1 seconds with Munger and an average of 2.8
- seconds with myMunger. Now I don’t need two buffers for case–ignored
- searches because I don’t have to copy an upper–case version of the buffer.
- —Added Ignore Diacriticals option in Search Options popup menu. Be careful
- when using the Hex Search button as the Ignore Case and Ignore
- Diacriticals options *still* apply to your resulting hex string. E.g.:
- Search String “0x61” (‘a’) will turn into “0x41” (‘A’) if Ignore Case is
- turned on.
- —When a search is started, disabled Hex Search button and changed Search
- button to Stop so it’s more obvious that the search can be stopped.
- Clicking the Stop button, hitting Return, Enter, Escape, or Command–.
- all stop the search. Also disabled my menus and handled mouseDown’s in
- menubar and drag region.
- —I was comparing File Safari’s search results to that of Search Files when
- I noticed FS found more matches than SF with the same options turned on.
- So I thought it’d be nice to have a Save Results function so I could
- compare FS’s to SF’s. This is now an item in the File menu. BTW, FS’s
- and SF’s search times are almost identical in my tests. FS took 1 second
- longer to search one of my hard drives with Ignore Case and TEXT Files
- Only turned on.
- —Found Search Files’ problem; it doesn’t find a match if the search string
- is butted up against the end of the file. File Safari does this correctly.
- Nyah. :) It also searches folders in a more intelligent manner.
-
-
- Changes in 1.0b4 — 94\12\28:
- —Fixed bug where Resource Editor menu item string would contain
- garbage until a rez editor was chosen.
- —Fixed bug that would set the Resource Editor string to empty
- if the user chose Choose resource editor… and clicked Cancel.
- —Added a default TEXT File Editor that can be used to view all
- TEXT files when double–clicked. It’s chosen like the Resource
- Editor and has a menu item to turn on/off using it.
- —Improved pref loading scheme so new prefs will be created if
- they aren’t found, and old prefs that aren’t the current size
- will be deleted and re–created.
- —Changed all menu item strings to title case.
- —The window is now dragable. Ooops. :)
- —If the current Search Dir is one from the popup, and the user
- deletes that item from the popup, the Add Current Search Dir
- menu item is re–enabled.
- —If the Option key is held while double–clicking on a match in
- the results, the user’s TEXT editor will be used to open the
- file, no matter what type the file is or which fork the match
- was found in. This is a power user feature, and is especially
- useful for people who have Really Cool App’s like MuffEdit that
- can open *any* file’s data fork and also snoop in the rez fork.
- —Got rid of desk scrap purging if the scrap was not TEXT data.
- Stopped bad practice of doing ZeroScrap and TEToScrap when
- switching to the background.
-
-
- Changes in 1.0b3 — 94\12\21:
- —Added drag & drop of folders and disks to set the Search Dir.
- —Added openDoc and quitApp Æ’s.
- —Changed the name of the main window to File Safari.
- —Fixed more Balloon Help.
- —Fixed some incompatibilities with Norton Directory Assistance.
- Hopefully this will fix the problems with SuperBoomerang too.
- I don’t know why these companies can’t write stuff that doesn’t
- interfere with standard Apple routines. If you’re gonna change
- the current dir, then tell the goddamn hook that you did so!
- I also found that, if a button has been added to a CustomGetFile
- box, and you SetDialogDefaultItem on it while the standard Open
- button is disabled, NDA doesn’t know about it, but instead sends
- an itemHit message of 0x1000 + the char number. Bad, bad, bad
- programming style not to call the standard ModalDialog filter
- when you mess with dialog events.
- —It was reported that no matches are found on a PPC, even though
- it’s searching through the correct files. I have no idea why
- this wouldn’t work, unless Munger doesn’t work correctly on PPC’s.
- I changed the FSRead/Munger buffer pointer to a handle just to
- see if that has anything to do with it, which I really doubt.
- —Added version number to About box.
- —Improved finding a double–clicked file’s creator, launching it,
- bringing it to the front, and sending the openDoc Æ.
- —Implemented the resource editor stuff.
- —Correctly enabled Add Current Search Dir popup menu item and
- Search button when a folder/volume is drag & dropped onto File
- Safari in the Finder.
-
-
- Changes in 1.0b2 — 94\12\16:
- —Added current file pathname to main window while searching.
- —Added Matches item in dialog.
- —Fixed some Balloon Help.
- —Added check for System 7.
- —Added check for B&W and put up the B&W version of the About PICT.
- —Added call to smallEvent at the end of the searchInFile loop so
- we don’t have to wait as long to abort.
- —Added SystemTask to smallEvent so some other stuff could process.
- —After a search has completed, select the Search String text.
- —Set the cursor to arrow when suspend/resume event is received.
- —When clicking on an item in the result list, the file name is
- shown.
- —Progress information is shown while finding a double–clicked–on
- file’s creator and process or app, and sending the AEOpenDoc.
- —Fixed it so when the result list is clicked past the end of the
- last line, it selects the last line.
-
-
- 1.0b1 — 94\12\15?:
- —Initial beta release.
-
- */